﻿using System;

namespace CSharpConsoleTestSolution.Bean {
    /**
     * 结构体 Student
     */
    public struct Struct_Student: ISpeak {
        public int Id;  //{ get; set; }
        public string Name;
        public long Score;

        //不能有显式无参构造器, 报错
        // public Struct_Student() {
        // }

        //可以有"全参"构造
        public Struct_Student(int id, string name, long score) {
            this.Id = id;
            this.Name = name;
            this.Score = score;
        }

        public override string ToString() {
            return $"{{Id = {Id}, Score = {Score}, Name = {Name}}}";
        }

        public void Speak() {
            Console.WriteLine($"Speak: I'm #{Id} student {Name}.");
        }
    }

    public interface ISpeak {
        void Speak();
    }
}